using System;
using System.Collections.Generic;
using System.Text;
using LispInterpretor.DataTypes;
using LispInterpretor.HelperClasses;

namespace LispInterpretor.InBuiltProcedures
{
    public class Add : Procedure
    {
        public override object Apply(params object[] args)
        {
            Number accumlator = new Number(0, 1);

            foreach (object arg in args)
            {
                Check.IsTrue(arg is Number, "Can't sum none number type.");
                
                accumlator = Number.Add((Number)arg, accumlator);
            }

            return accumlator;
        }
    }
}
